'use strict';
define(function(require, exports, module) {

	var app = angular.module('myApp', ['ui.router']);
	// app.config(function($controllerProvider, $compileProvider, $filterProvider, $provide) {
	// 	app.register = {
	// 		controller: $controllerProvider.register,
	// 		directive: $compileProvider.directive,
	// 		filter: $filterProvider.register,
	// 		factory: $provide.factory,
	// 		service: $provide.service
	// 	};
	// });

	// app.asyncjs = function(js) {
	// 	return ["$q", "$route", "$rootScope", function($q, $route, $rootScope) {
	// 		var deferred = $q.defer();
	// 		var dependencies = js;
	// 		// if (Array.isArray(dependencies)) {
	// 		// 	for (var i = 0; i < dependencies.length; i++) {
	// 		// 		dependencies[i] += "?v=" + v;
	// 		// 	}
	// 		// } else {
	// 		// 	dependencies += "?v=" + v; //v是版本号
	// 		// }
	// 		$script(dependencies, function() {
	// 			$rootScope.$apply(function() {
	// 				deferred.resolve();
	// 			});
	// 		});
	// 		return deferred.promise;
	// 	}];
	// };


	//添加路由


	var sRouter = require('../common/js/srouter');

	sRouter.stateRoute(app, 'login', '/login', 'app/login/view/login.html', '../../app/login/js/loginController');
	sRouter.stateRoute(app, 'register', '/register', 'app/register/view/register.html', '../../app/register/js/registerController');

	angular.bootstrap(document.body, ['myApp']);

	console.info("app starting...");

});